/**
 * Baijiahulian.com Inc. Copyright (c) 2014-2016 All Rights Reserved.
 */
package com.baijia.web.dto;

import lombok.Data;

/**
 * @title MobileResponse
 * @desc TODO
 * @author macrohuang
 * @date Jan 22, 2016
 * @version 1.0
 */
@Data
public class MobileResponse<T> {

    public static transient int STATUS_OK = 0;
    public static transient int STATUS_FAIL = 1;

    private int code = STATUS_OK;
    private T data;
    private String msg;

    public MobileResponse<T> fail() {
        code = STATUS_FAIL;
        return this;
    }

    public MobileResponse<T> msg(String msg) {
        this.msg = msg;
        return this;
    }

    public MobileResponse<T> data(T data) {
        this.data = data;
        return this;
    }
}
